package com.wupx.codegenerator;

import com.baomidou.mybatisplus.annotation.DbType;
import com.wupx.codegenerator.util.CommonUtils;

/**
 * MySQL 数据库代码生成类
 *
 * @author wupx
 * @since 2020-11-18
 */
public class MySqlCodeGenerator {

    public static void main(String[] args) {
        DbType dbType = DbType.MYSQL;
        String dbUrl = "jdbc:mysql://127.0.0.1:3306/sync?characterEncoding=utf8";
        String username = "root";
        String password = "123456";
        String driver = "com.mysql.cj.jdbc.Driver";
        // 表前缀，生成的实体类，不含前缀
        String[] tablePrefixes = {"t_"};
        // 表名，为空，生成所有的表
        String[] tableNames = {};
        // 字段前缀
        String[] fieldPrefixes = {"f_"};
        // 基础包名
        String packageName = "com.wupx.sync";
        CommonUtils.execute(dbType, dbUrl, username, password, driver, tablePrefixes, tableNames, packageName, fieldPrefixes);
    }

}
